<template>
  <div>
    <mt-header title="登录"></mt-header>
    <div>
      <mt-field style="margin-top: 50px" label="账号" placeholder="请输入账号" v-model="account"></mt-field>
      <mt-field label="密码" placeholder="请输入密码" type="password" v-model="passwd"></mt-field>
    </div>

    <div  style="margin-left: 10px; margin-right: 10px;margin-top: 50px">
      <mt-button @click="loginAction" style="width: 100%" size="primary">登录</mt-button>
    </div>

  </div>
</template>

<script>
    export default {
      name: "login",
      data(){
        return {
          account: 'admin',
          passwd:"admin",
        }
      },
      methods:{
          loginAction:function () {
           
            Cordova.exec(this.testSuccess,this.testFailed,"MyTestPlugin","testMethod",["我是JS传的参数！"]);

            if (this.account != 'admin' && this.passwd != 'admin') {
              alert(this.account + this.passwd);
            }else {

              this.$router.push({
                name:'devList',
              });
            }
          },
          testSuccess:function (){

          },
          testFailed:function(){

          }



      }
    }
</script>

<style scoped>

</style>
